|
|
|
|
|
|
|
Figure T10-1:
Format of buffer loaded with ENUM_SERVICE_STATUS structures |
|
|
|
|
|
|
|
|
3. Set the BytesNeeded parameter to the size of buffer needed to hold the remaining services, and |
|
|
|
|
|
|
|
|
4. Set the ResumeHandle parameter to a value used internally to tell the system which service to load first during the next call. |
|
|
|
|
|
|
|
|
These parameter values can be changed because they were passed by reference (see how the pieces begin to fall together?). The function returns a value of 0 and sets the Err.LastDllError property to the constant ERROR_MORE_DATA if there are more services to read. |
|
|
|
|
|
|
|
|
For each service, the routine creates a ServiceStatus object. It then passes the buffer along with an offset to the object's ParseServiceInfo method. This method scans the buffer and extracts the service's status information, as you will see shortly. |
|
|
|
|
|